package user

import (
	. "go-server/handler"

	"github.com/gin-gonic/gin"
	"github.com/lexkong/log"
)

func Update(c *gin.Context) {

	var r UserInfo

	id := c.Param("id")

	log.Info(id)

	if err := c.Bind(&r); err != nil {
		SendResponse(c, err, nil)
		return
	}

	log.Info(r.Username)
	log.Info(r.Password)

	SendResponse(c, nil, gin.H{
		"id":       id,
		"username": r.Username,
		"password": r.Password,
	})
}
